﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace TestGenerator.Input
{
    public class Initialize
    {
        private static string initializeFileName;
        private string inputFileName;
        private string outputFileNamePrefix;
        private string answersFilename;
        private int testToGenerate;
        private int maxQuestions;
        private int maxAnswers;

        static Initialize()
        {
            initializeFileName = "TestGenerator.ini";
        }

        public Initialize()
        {
            using (StreamReader reader = new StreamReader(initializeFileName))
            {
                inputFileName = reader.ReadLine().Split('=')[1];
                outputFileNamePrefix = reader.ReadLine().Split('=')[1];
                answersFilename = reader.ReadLine().Split('=')[1];
                testToGenerate = int.Parse(reader.ReadLine().Split('=')[1]);
                maxQuestions = int.Parse(reader.ReadLine().Split('=')[1]);
                maxAnswers = int.Parse(reader.ReadLine().Split('=')[1]);
            }
        }

        public string InputFileName
        {
            get
            {
                return inputFileName;
            }
        }

        public string OutputFileNamePrefix
        {
            get
            {
                return outputFileNamePrefix;
            }
        }

        public int TestToGenerate
        {
            get
            {
                return testToGenerate;
            }
        }

        public int MaxQuestions
        {
            get
            {
                return maxQuestions;
            }
        }

        public int MaxAnswers
        {
            get
            {
                return maxAnswers;
            }
        }

        public string AnswersFileName
        {
            get
            {
                return answersFilename;
            }
        }
    }
}
